<template>
  <!-- <el-form-item :label="label"> -->
  <el-date-picker
    v-model="currentValue"
    :picker-options="pickerOptions"
    :value-format="format"
    :type="date"
    :placeholder="label"
    @input="onInputEvent"
  />
  <!-- </el-form-item> -->
</template>

<script>
export default {
  // eslint-disable-next-line vue/require-prop-types
  props: ['label', 'name', 'value', 'format', 'date', 'pickerOptions'],
  data() {
    return {
      currentValue: this.value
    }
  },
  methods: {
    onInputEvent(value) {
      this.$emit('input', this.name, value)
    }
  }
}
</script>
